home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / hockey.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-30  |  1.9 KB  |  107 lines

  1. #ifndef _hockey_h
  2. #define _hockey_h
  3.  
  4. #ifndef _vec2_h
  5. #    include "vec2.h"
  6. #endif
  7. #ifndef _game_h
  8. #    include "game.h"
  9. #endif
  10.  
  11. class BallMover;        // forward
  12. class Goal;
  13. class StaticBall;
  14. class Wall;
  15.  
  16. class Hockey : public Game {
  17.     public:
  18.         static Real    TableWidth;
  19.         static Real TableHeight;
  20.  
  21.         Hockey(double wx=TableWidth, double wy=TableHeight);
  22.         virtual ~Hockey();
  23.  
  24.         virtual const Real & GetPresetA() const;
  25.         virtual const Real & GetPresetHaft() const;
  26.         virtual const Real & GetSlowGranularity() const;
  27.  
  28.         virtual const Real & GetNormalBallSize() const;
  29.  
  30.         virtual const Real AreaOffX() const;
  31.         virtual const Real AreaOffY() const;
  32.         virtual const Real AreaWidth() const;
  33.         virtual const Real AreaHeight() const;
  34.  
  35.         virtual void InitPlayground();
  36.         virtual void DrawBackground() const;
  37.  
  38.         void InitArea( double wx, double wy );
  39.         void InitTable();
  40.  
  41.         virtual void InPocket( Ball *b );
  42.         virtual void StopBall( Ball *b );
  43.  
  44.         static Real PresetA;
  45.         static Real PresetHaft;
  46.         static Real SlowGranularity;
  47.  
  48.         static Real FrameOffset;
  49.         static Real GoalSize;
  50.  
  51.         static Real DiscRadius;
  52.         static Real HandRadius;
  53.         static Real DiscWeight;
  54.         static Real HandWeight;
  55.  
  56.         static Real    GoalFrame;
  57.         static Real GoalHeight;
  58.  
  59.     protected:
  60.         Real area_off_x;
  61.         Real area_off_y;
  62.         Real area_width;
  63.         Real area_height;
  64.  
  65.         BallMover    *mdisc;
  66.         BallMover    *mhand;
  67.  
  68.         ColorId        table_col;
  69.         ColorId        red_bg_col;
  70.         ColorId        blue_bg_col;
  71.  
  72.         ColorId        disc_col;
  73.         ColorId        hand_col;
  74.  
  75.     protected:
  76.         Vec2        mid;
  77.         Vec2        edge[4];
  78.         Goal            *goal[2];
  79.         StaticBall    *post[2][2];
  80.         Wall            *w[2][3];
  81.  
  82.         int            disc_in_goal;
  83.         Ball            *disc;
  84.         Ball            *hand1, *hand2;
  85. };
  86.  
  87. class TestHockey : public Hockey {
  88.     public:
  89.         TestHockey(double speed=100.0);
  90.         virtual ~TestHockey();
  91.  
  92.         virtual const Real &GetPresetA() const;
  93.         virtual const Real &GetSlowGranularity() const;
  94.  
  95.         virtual void InitPlayground();
  96.  
  97.         static Real    PresetA;
  98.         static Real    SlowGranularity;
  99.  
  100.     private:
  101.         Real    shot_speed;
  102.  
  103.         Wall    *w[4];
  104. };
  105.  
  106. #endif
  107.